<template>
  <div style="width: auto; height: 225px" id="echarts2"></div>
</template>
 
<script>
import { getprofit } from "../api/show";
import echarts from "echarts";
export default {
  name: "echarts2",
  data() {
    return {
      // option配置
      option: {
        title: {
          text: "股东比例",
          subtext: "个人",
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          orient: "vertical",
          left: "left",
        },
        series: [
          {
            name: "股东比例表",
            type: "pie",
            radius: "50%",
            data: [
               { name: "男",value: 5},
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: "rgba(0, 0, 0, 0.5)",
              },
            },
          },
        ],
      },
    };
  },
  mounted() {
    this.getProfit();
  },
  methods: {
    getProfit() {
      getprofit().then((res) => {
        if (res.data.code == 200) {
          this.option.series[0].data = res.data.data;
          echarts.init(document.getElementById("echarts2")).setOption(this.option);
        }
      });
    },
    
  },
};
</script>
 
<style scoped>
</style>
